<template>
  <div id="example">
    {{ count }}
    {{ name }}
    {{ age }}
    <button @click="increment()" class="button-click">点击count变化</button>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  computed: {
    ...mapState(["count", "name", "age"]),
  },
  created() {},
  methods: {
    increment() {
      this.$store.commit("increment");
    },
  },
};
</script>
<style scoped>
.button-click {
  color: aqua;
}

.button-click:active {
  color: rgb(184, 21, 184);
}

.button-click:hover {
  color: rgb(20, 216, 151);
}
</style>
